<template>
	<view class="contentBox" >
		<template v-if="publishList.length>0">
		<view class="publishBut"></view>
		<view class="publishList" @tap="toTopic(index)" v-for="(item,index) in publishList" :key='index'>
		<view class="publishListTitle">{{item.title}}</view>
		<view class="publishListBottom"><text>{{item.collection_time}}</text></view>
		</view>
		</template>
		<template v-else>
			<no-thing></no-thing>
		</template>	
	</view>
</template>

<script>
	import noThing from"../../components/common/no-thing.vue"
	export default {
		components: {
			noThing		
		},
		data() {
			return {
				publishList:[]
			};
		},
		onReady() {
			this.getUserCollect()
		},
		methods:{
			getUserCollect(){
				uni.request({
					url:this.confige.webUrl+"/essay/selectUserCollection",
					header:{
						'X-Token':this.User.token
					},
					data:{
					},
					success: (res) => {
						console.log(res);
						this.publishList = res.data.result;
					}	
				})
			},
			toTopic(index){
				// console.log(index);
				// console.log(this.publishList);
				var id = this.publishList[index].essayId
				uni.navigateTo({
					url:"../indexTopic/topic?id="+id
				})
			}
		}
	}
</script>

<style lang="less" scoped>
page{ background-color: #FFFFFF;}
.publishBut{ width: 100%;height: 60upx;padding-top: 20upx; >button{ width:150upx;font-size: 30upx; height: 60upx;line-height: 60upx;float: right;}}
.contentBox{ width: 94%; margin: auto;}
.publishList{ border-bottom: 1upx solid #bfbfbf; margin-top:15upx;}
.publishListTitle{ overflow: hidden;white-space:nowrap;text-overflow: ellipsis;  font-size: 30upx; }
.publishListBottom{ display: flex;justify-content: space-between; padding: 15upx; font-size: 20upx;
>text:nth-of-type(1){
	  font-size: 25upx;
	   color:#777777;;
}
>text:nth-of-type(2){
	 border-left: 5upx solid #0081FF;
	  padding-left: 15upx;
	  font-size: 25upx;
}}

</style>

